libname inn "D:\Amazon Price Dynamics\New Data\GAM + MVRF\Other categories\Microwaves";
data final_gam_modeldata;
set inn.final_gam_modeldata_microwave;
run;

proc contents data = final_gam_modeldata;
run;


/**Kenmore and LG**/


	data knmore_sales (keep = time1 Sales_Rank_Own_Categ_knmore buyboxprice_knmore buyboxprice_knmore_lag1);
	set FINAL_GAM_MODELDATA;
	where Sales_Rank_Own_Categ_knmore > 0;
	run;

	
	data lg_sales (keep = time1 Sales_Rank_Own_Categ_lg buyboxprice_lg buyboxprice_lg_lag1);
	set FINAL_GAM_MODELDATA;
	where Sales_Rank_Own_Categ_lg > 0;
	run;


	
data totsales_knmore;
set knmore_sales;
daily_sales_knmore = exp(10.82981 - 0.73292*log(Sales_Rank_Own_Categ_knmore)) -1;
RUN;
data totsales_lg;
set lg_sales;
daily_sales_lg = exp(10.82981 - 0.73292*log(Sales_Rank_Own_Categ_lg)) -1;
RUN;

/**modeling sales as a function of buy box price - current and 1 period lag***/

/***Kenmore****/
proc reg data = totsales_knmore;
model daily_sales_knmore = 
buyboxprice_knmore buyboxprice_knmore_lag1
;
run;


/***LG****/
proc reg data = totsales_lg;
model daily_sales_lg = 
buyboxprice_lg buyboxprice_lg_lag1;
run;
quit;
